package com.yang.controller;


import com.yang.mapper.FootMapper;
import com.yang.pojo.Foot;
import com.yang.service.FootService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 朝阳
 * @since 2021-11-24
 */
@RestController
@RequestMapping("/foot")
public class FootController {

//    @Autowired
//    private FootService footService;
//
//    @PostMapping("/queryAllFoot")
//    public Result queryAllFoot(){
//        List<Foot> feet = footService.list(null);
//        if (feet != null){
//            return new Result(100,"查询成功",feet);
//        }
//        return new Result(200,"代码有问题请联系QQ：2655906529");
//    }
//
//    @PostMapping("/updataOneFoot")
//    public Result updataOneFoot(@RequestBody Foot foot){
//        String regex = "^.{3,32}$";
//        if (foot.getFoottitle().matches(regex) && foot.getFootauthor().matches(regex) && foot.getFootinformation().matches(regex) && foot.getFooturl().matches(regex) && foot.getFooticp().matches(regex) && foot.getFooticpurl().matches(regex) && foot.getFootrecord().matches(regex) && foot.getFootrecordurl().matches(regex)){
//            foot.setFootid(foot.getFootid());
//            foot.setFoottitle(foot.getFoottitle());
//            foot.setFootauthor(foot.getFootauthor());
//            foot.setFootinformation(foot.getFootinformation());
//            foot.setFooturl(foot.getFooturl());
//            foot.setFooticp(foot.getFooticp());
//            foot.setFooticpurl(foot.getFooticpurl());
//            foot.setFootrecord(foot.getFootrecord());
//            foot.setFootrecordurl(foot.getFootrecordurl());
//            boolean b = footService.updateById(foot);
//            if (b==true){
//                return new Result(100,"插入成功",b);
//            }
//            return new Result(200, "代码有问题请联系QQ：2655906529");
//        }
//        return new Result(200, "格式错误");
//    }
}

